<?php

namespace app\model;

use think\Model;

/**
 * @property string $avatar 头像
 * @property string $blacklist 黑名单
 * @property integer $create_time 创建时间
 * @property integer $id 主键(主键)
 * @property string $name 昵称
 * @property integer $rid 角色id
 * @property integer $update_time 更新时间
 */
class Admin extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'kllxs_admin';

    /**
     * The primary key associated with the table.
     *
     * @var string
     */
    protected $pk = 'id';

    /**
     * 关联 function
     *
     * @return void
     */
    public function role()
    {
        return $this->hasOne(AdminRole::class, "id", "rid");
    }
}
